<?php
	$xtpl = new XTemplate('Html/best_buy.html');
    $sql = "SELECT Title FROM tbl_article where type = 'BB'";
    $query = mysql_query($sql);
    //check data 
    if(mysql_num_rows($query)==0){
        echo 'Data not found';
    }
    else{
        while($rows= mysql_fetch_array($query)){
            $xtpl->assign('Bestbuy'.$rows);
            $xtpl->parse('Best_buy');
        }
    }
    $xtpl->out('Best_buy');
?>